﻿<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>input监听-jq22.com</title>
<script src="http://libs.baidu.com/jquery/1.11.3/jquery.min.js"></script>
<style>
</style>
</head>
<body>
<h1>
    实时监测input中值的变化
</h1>
<input type="text" id="username" autoComplete='off'>
<div id="result"></div><script>
$(function() {
    $('#username').bind('input propertychange', function() {
        $('#result').html($(this).val().length + ' characters');
    });
})</script>
</body>
</html>
